package zhouzhouyongche.action;

import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;

import zhouzhouyongche.service.UserService;

@Controller
@Action(value = "user")
public class UserAction extends BaseAction {

	private static final long serialVersionUID = 1L;

	private int userId;
	private String phoneNumber;
	private String password;
	
	@Autowired
	private UserService userService;
	
	public void signIn() {
		int result = userService.signIn(phoneNumber, password);
		writeJson(result);
	}
	
	public void signUp() {
		int result = userService.signUp(phoneNumber, password);
		writeJson(result);
	}
	
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

}
